package com.qfedu.zy.services.impl;

import com.qfedu.zy.dao.UserDAO;
import com.qfedu.zy.pojos.User;
import com.qfedu.zy.services.iUserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IUserServiceImpl implements iUserService {

    @Autowired
    private UserDAO userDAO;

    public void saveUser(User user) {

    }

    public void queryUser(String userName, String userPwd)throws Exception {
        UsernamePasswordToken token = new UsernamePasswordToken(userName,userPwd);

        Subject subject = SecurityUtils.getSubject();

        subject.login(token);

    }
}
